
#ifndef __LIB_C_STRING_H__
#define __LIB_C_STRING_H__

#define MEMCPY(dest, src, len)			ali_memcpy(dest, src, len)
#define MEMCMP(buf1,buf2, len)			ali_memcmp(buf1,buf2, len)
#define MEMSET(dest, c, len)			ali_memset(dest, c, len)
#define MEMMOVE(dest, src, len)			ali_memmove(dest, src, len)

#define STRCPY(dest,src)				ali_strcpy(dest,src)
#define STRCMP(dest,src)				ali_strcmp(dest,src)
#define STRLEN(str)						ali_strlen(str)

#define ITOA(str, val)					ali_itoa(str, val)
#define ATOI(str)					ali_atoi(str)
#define ATOI16(str)				ali_atoi16(str)

#define RAND(max_val)			ali_rand(max_val)

#ifdef __cplusplus
extern "C"
{
#endif

void* ali_memcpy(void *dest,const void *src, unsigned int len);
void* ali_memset(void *dest, int  c,unsigned int  len);
int ali_memcmp(const void *buf1,const void *buf2,unsigned int  len);
void * ali_memmove(void * dest,const void * src, unsigned int  n);


char* ali_strcpy(char *dest, const char *src);
int ali_strcmp(const char *dest, const char *src);
unsigned long ali_strlen(const char *src);

int ali_itoa(char * str, unsigned long val);
int ali_atoi(const char * str);
unsigned long ali_atoi16(const char * str);



//porting functions
void* libc_memcpy(void *dest,const void *src, unsigned int len);
void* libc_memset(void *dest, int  c,unsigned int  len);
int libc_memcmp(const void *buf1,const void *buf2,unsigned int  len);
void * libc_memmove(void * dest,const void * src, unsigned int  n);


char* libc_strcpy(char *dest, const char *src);
int libc_strcmp(const char *dest, const char *src);
unsigned long libc_strlen(const char *src);

int libc_itoa(char * str, unsigned long val);
int libc_atoi(const char * str);
unsigned long libc_atoi16(const char * str);

#ifdef __cplusplus
}
#endif

#endif /* __LIB_C_STRING_H__ */
